<%--
公司等待竞单的列表
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%pageContext.setAttribute("APP_PATH", request.getContextPath());%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>维修方</title>
    <meta name="description" content="Static &amp; Dynamic Tables" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <script src="${APP_PATH }/recourse/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="${APP_PATH }/recourse/css/font.css">
    <link rel="stylesheet" href="${APP_PATH}/recourse/css/login.css">
    <link rel="stylesheet" href="${APP_PATH }/recourse/css/xadmin.css">
    <script src="${APP_PATH }/assets/js/jquery-2.1.4.min.js"></script>
    <script src="${APP_PATH }/recourse/js/jquery-form.js"></script>
    <script type="text/javascript" src="${APP_PATH }/assets/js/xadmin.js"></script>
</head>

<body >
    <form id = "mation" name="mation" action="" method="post" >
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin-left: 35px;">
            <ul class="layui-tab-title">
                <li class="layui-this">维修单详情</li>
                <li id="bg_two">问题图片/视频</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <table width="650" height="300"  border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><b>维修单名称：</b>${order.order_name}</td>
                            <td><b>维修单编号：</b>${order.id}</td>
                        </tr>
                        <tr>
                            <td><b>维修单目前状态：</b>${order.state_name}</td>
                            <td><b>报修人员：</b>${order.equipment_admin_name}</td>
                        </tr>
                        <tr>
                            <td><b>维修单所属部门：</b>${order.department_id==1?"营房":(order.department_id==2?"装备":"公共")}</td>
                            <td><b>维修单拟定价格：</b>${order.second_price}元</td>
                        </tr>
                        <tr>
                            <td><b>报修单位：</b>${order.insiderUnit_name}</td>
                            <td><b>维修单发起时间：</b><fmt:formatDate value="${order.createTime}" type="date"/></td>
                        </tr>
                    </table>
                    <p style="color: #0C0C0C;">设备管理员维修要求：</p><br>
                    <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                        ${a.equals("")?(f.equals("")?"无":f):a}
                    </div>
                    <p style="color: #0C0C0C;margin-top: 10px;">审核员维修要求：</p><br>
                    <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                        ${b.equals("")?"无":b}
                    </div>
                    <table width="650" height="50"  border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <b>维修问题表述：</b><br>
                            </td>
                        </tr>
                    </table>
                    <div  class="module line-clamp" style="background-color: #F5F5F5 ;height: 80px;width: 700px">
                        ${order.problem_word}
                    </div>
                    <hr/>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="x-red">*</span>拒绝原因</label>
                        <div class="layui-input-inline" style="width: 320px">
                            <textarea id="states" name="states" placeholder="请输入无法维修的理由" class="layui-textarea"></textarea>
                        </div>
                        <div class="layui-form-mid layui-word-aux">
                            <span class="x-red">*</span>拒绝指派会影响个人评价
                        </div>
                    </div>

                    <input  id="sub1" type="submit" class="layui-btn layui-btn-radius" style="margin-left: 150px;margin-top: 35px;" value="接受指派"/>
                    <button id="sub0" class="layui-btn layui-btn-radius layui-btn-danger" type="submit" style="margin-left: 40px;margin-top: 35px;" onclick="rxs()">拒绝指派</button>
                </div>
                <div class="layui-tab-item">
                    <br>
                    <p>图片信息</p>
                    <div style="width:100%;margin:0 auto;">
                        <c:forEach items="${photoes}" var="p_list" varStatus="status">
                            <div class="img">
                                <img border="12dp" src="/mmmsimage/${p_list}" alt="暂无图片信息" style="width:25%">
                            </div>
                        </c:forEach>
                    </div>
                    <br>
                    <p>视频信息</p>
                    <c:forEach items="${videos}" var="list_v" varStatus="status">
                        <video width="320" height="240" style="margin-left: 200px;" controls autoplay>
                            <source src="/mmmsimage/${list_v}" type="video/mp4">
                            <object data="/mmmsimage/${list_v}" width="380" height="260">
                                <embed width="320" height="240" src="/mmmsimage/${list_v}">
                            </object>
                        </video><br>
                    </c:forEach>
                </div>
            </div>
        </div>
        <input id="id" type="hidden" name="id" value="${order.id}"/>
    </form>
<script type="text/javascript">
    $(document).ready(function () {
        $('#sub1').click(function () {
            var mf = document.getElementById("mation");
            mf.action="${pageContext.request.contextPath}/company/agree";
            $('#mation').ajaxForm(function (data) {
                if (data === 0) {
                    alert("提交成功!");
                    setTimeout(function () {
                        // 这里就是处理的事件
                        window.close();
                        window.opener.location.reload();
                    }, 700);
                } else {
                    alert("提交失败!")
                }
            });
        });
    });

    function rxs () {
        var reason = document.getElementById("states").value;
        if (reason !== "") {
            var mf = document.getElementById("mation");
            mf.action="${pageContext.request.contextPath}/company/disagree";
            $('#mation').ajaxForm(function (data) {
                if (data === 0) {
                    alert("提交成功!");
                    setTimeout(function () {
                        // 这里就是处理的事件
                        window.close();
                        window.opener.location.reload();
                    }, 500);
                } else {
                    alert("提交失败!");
                }
            });
        }else{
            var mf = document.getElementById("mation");
            mf.action="";
            alert("无法维修的原因为必填项");

        }
    }

</script>
<style type="text/css">
    .img{width: 900px;margin: 50px auto; overflow: hidden;}
    .img div{
        float: left;
        width:198px;
        margin-left: 20px;
    }
    .img div img{
        display: block;
        width: 100%;

    }
</style>
</body>
</html>




